$(function () {
    var myChart = echarts.init(document.getElementById('main1'));
  
    // 指定图表的配置项和数据
    var option = {
        title: {
            text: '2020年注册人数'
        },
        tooltip: {},
        legend: {
            data:['销量',"人数"]
        },
        xAxis: {
            data: ["1月","2月","3月","4月","5月","6月"]
        },
           yAxis: {},
        series: [{
            name: '销量',
            type: 'bar',
            data: [5, 20, 36, 10, 10, 20]
        },
        {
          name: '人数',
          type: 'line',
          data: [25, 40, 30, 15, 30, 35]
      }
      ]
    };
  
    // // 使用刚指定的配置项和数据显示图表。
    myChart.setOption(option);
  })
  $(function () {
    var myChart = echarts.init(document.getElementById('main2'));
    option = {
        tooltip: {
            trigger: 'item',
            formatter: "{a} <br/>{b}: {c} ({d}%)"
        },
        legend: {
            orient: 'vertical',
            x: 'right',
            data:['aj','老北京','新百伦','乔丹','滑板鞋']
        },
        series: [
            {
                name:'访问来源',
                type:'pie',
                radius: ['50%', '70%'],
                avoidLabelOverlap: false,
                label: {
                    normal: {
                        show: false,
                        position: 'center'
                    },
                    emphasis: {
                        show: true,
                        textStyle: {
                            fontSize: '30',
                            fontWeight: 'bold'
                        }
                    }
                },
                labelLine: {
                    normal: {
                        show: false
                    }
                },
                data:[
                    {value:335, name:'aj'},
                    {value:310, name:'老北京'},
                    {value:234, name:'新百伦'},
                    {value:135, name:'乔丹'},
                    {value:1548, name:'滑板鞋'}
                ]
            }
        ]
    };
    myChart.setOption(option);
    })

  